/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.cip.esymons.tesoreria.bc;

import org.cip.esymons.tesoreria.be.DetDocupago;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;

/**
 *
 * @author Gilmar Montoya
 */
public class DetDocupagoDelegate {
    private DetDocupagoFacadeLocal local;

    public DetDocupagoDelegate() {
        local=lookupDetDocupagoFacade();
    }

    public void create(DetDocupago DetDocupago){
        local.create(DetDocupago);
    }

    public void edit(DetDocupago DetDocupago){
        local.edit(DetDocupago);
    }

    public void remove(DetDocupago DetDocupago){
        local.remove(DetDocupago);
    }

    public DetDocupago find(Object id){
        return local.find(id);
    }

    public List<DetDocupago> findAll(){
        return local.findAll();
    }

    private DetDocupagoFacadeLocal lookupDetDocupagoFacade() {
        try {
            Context c = new InitialContext();
            return (DetDocupagoFacadeLocal) c.lookup("java:comp/env/DetDocupagoFacade");
        } catch (NamingException ne) {
            Logger.getLogger(getClass().getName()).log(Level.SEVERE, "exception caught", ne);
            throw new RuntimeException(ne);
        }
    }

    

}
